package o;

import android.content.Context;
import o.brc.e;

public class bwn {
    private static bwn ˎ = new bwn();

    public static bwn ˏ() {
        return ˎ;
    }

    public fjo<Boolean> ˊ(Context context, final bqv o_bqv) {
        bqx.ˏ("ReadAllMessageManager", "------read all message DOMAIN_ID = " + o_bqv.ˎ());
        final fjx o_fjx = new fjx();
        ((cbh) fho.ˏ().ˋ("User").ॱ(cbh.class)).ˎ(context, 1).ˏ(new fjq<Boolean>(this) {
            final /* synthetic */ bwn ॱ;

            public void onComplete(fjo<Boolean> o_fjo_java_lang_Boolean) {
                if (!o_fjo_java_lang_Boolean.ˊ()) {
                    bqx.ˋ("ReadAllMessageManager", "----task.isSuccessful =" + o_fjo_java_lang_Boolean.ˊ());
                    o_fjx.ॱ(Boolean.valueOf(false));
                } else if (((Boolean) o_fjo_java_lang_Boolean.ॱ()).booleanValue()) {
                    this.ॱ.ˋ(o_bqv, o_fjx);
                } else {
                    bqx.ˋ("ReadAllMessageManager", "----task.getResult =" + o_fjo_java_lang_Boolean.ॱ());
                    o_fjx.ॱ(Boolean.valueOf(false));
                }
            }
        });
        return o_fjx.ॱ();
    }

    private void ˋ(bqv o_bqv, final fjx<Boolean> o_fjx_java_lang_Boolean) {
        bwk o_bwk = new bwk();
        o_bwk.ॱ(o_bqv);
        ((brc) fho.ˏ().ˋ("Base").ॱ(brc.class)).ˋ(o_bwk, new e<bwk, bwt>(this) {
            final /* synthetic */ bwn ˏ;

            public /* synthetic */ void ˋ(Object obj, Object obj2) {
                ˏ((bwk) obj, (bwt) obj2);
            }

            public /* synthetic */ void ˏ(Object obj, Object obj2) {
                ˎ((bwk) obj, (bwt) obj2);
            }

            public void ˎ(bwk o_bwk, bwt o_bwt) {
            }

            public void ˏ(bwk o_bwk, bwt o_bwt) {
                boolean z = false;
                if (o_bwt != null) {
                    fjx o_fjx = o_fjx_java_lang_Boolean;
                    if (o_bwt.getResponseCode() == 0 && o_bwt.getRtnCode_() == 0) {
                        z = true;
                    }
                    o_fjx.ॱ(Boolean.valueOf(z));
                    return;
                }
                o_fjx_java_lang_Boolean.ॱ(Boolean.valueOf(false));
            }
        });
    }
}
